package junit;

import java.util.Collection;

import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.junit.internal.matchers.TypeSafeMatcher;

public class IsNotEmptyMatcher extends TypeSafeMatcher<Collection<?>>{

        public IsNotEmptyMatcher()
        {}
        
        public void describeTo(Description description) {
                description.appendText("a collection that is not empty");
        }

        @Override
        public boolean matchesSafely(Collection<?> collection) {
                return !(collection.isEmpty());
        }
        
        @Factory
        public static Matcher<Collection<?>> isNotEmpty() {
                return new IsNotEmptyMatcher();
        }

}
